<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

 // Route::get('/', function () {
   // return view('welcome');
 // });

//注册模块
Route::get('/register','Home\RegisterController@register');
Route::post('/register','Home\RegisterController@doregister');

//邮箱激活路由
Route::get('/active','Home\RegisterController@active');

//找回密码
Route::get('/forget','Home\RegisterController@forget');
//发送密码找回邮件
//Route::post('/forget','Home\RegisterController@doforget');

//重置密码界面
//Route::get('/reset','Home\RegisterController@reset');
//密码重置逻辑路由
//Route::post('/reset','Home\RegisterController@doreset');


//发送手机验证码路由
Route::get('/mobile','Home\RegisterController@mobile');
Route::post('/sendcode','Home\RegisterController@sendCode');
Route::post('/mobile','Home\RegisterController@doadd');

 
Route::get('/',"Home\IndexController@index"); //加载前台首页

Route::get('/login',"Home\LoginController@login"); //加载登录界面
Route::post('/login',"Home\LoginController@dologin"); //执行前台登录
Route::get('/logout',"Home\LoginController@logout"); //执行前台退出
//Route::get('/code','Home\LoginController@code'); //加载验证码

Route::get('/home/list',"Home\IndexController@list"); //加载列表界面
Route::get('/home/cargo',"Home\IndexController@cargo"); //加载商品详情界面

//Route::get('/home/register',"Home\IndexController@register"); //加载注册界面
Route::get('/home/login',"Home\IndexController@login"); //加载登录界面
Route::get('/home/list/{id}',"Home\IndexController@Goods_list"); //加载列表界面
Route::get('/home/cargo/{id}',"Home\IndexController@cargo"); //加载商品详情界面
Route::get('home/cart/{id}',"Home\CartController@index"); //加载购物车界面




//网站后台路由配置

Route::get('admin/login',"Admin\LoginController@login"); //加载后台登录界面
Route::post('admin/dologin',"Admin\LoginController@doLogin"); //执行后台登录
Route::get('admin/logout',"Admin\LoginController@logout"); //执行退出
Route::get('admin/code','Admin\LoginController@code'); //加载验证码


//后台路由组
Route::group(['prefix' => 'admin','namespace'=>'Admin','middleware'=>'admin.login'], function () {
    
    Route::get('/','IndexController@index');//后台首页

    Route::get('pass','IndexController@pass');//修改密码路由
    Route::post('dopass','IndexController@dopass');//执行修改密码路由


    Route::resource('admin_user', 'Admin_userController');//后台会员管理 HEAD
    Route::post('upload','Admin_userController@upload'); //图片上传
    Route::get('auth/{id}',"Admin_userController@auth");
    Route::post('auth/add',"Admin_userController@add");

    Route::resource('role','RoleController');//角色模块
    Route::get('roleshow/{id}',"RoleController@roleshow");
    Route::post('roleshow/add',"RoleController@add");


    Route::resource('permission','PermissionController');//权限模块


    //    友情链接
    Route::resource('friend_link','Friend_linkController');
    Route::post('friend_link/changeorder','Friend_linkController@changeOrder');

    //商品类别管理
    Route::resource('category', 'CategoryController');
    //商品管理
    Route::resource('goods', 'GoodsController');
    Route::post('upload','GoodsController@upload');
    //订单管理
    Route::resource('orders', 'OrdersController');
    Route::get('aa', 'OrdersController@aa');
    Route::get('bb', 'OrdersController@bb');
    Route::get('cc', 'OrdersController@cc');
	
	//网站配置
    Route::resource('config','ConfigController');


 
});


